package light.head.dao.site;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import light.head.constant.Parm;
import light.head.enm.RESULT;
import light.head.framework.base.BaseDAO;
import light.head.framework.entity.PageBean;
import light.head.model.SupplyJoinInfo;
import org.springframework.stereotype.Service;
/**
 * 参加竞标的商家 留言信息
 */
@Service
public class SupplyJoinInfoDAO extends BaseDAO<SupplyJoinInfo, Serializable>{

	public RESULT findByMap(Map<String, String> map, PageBean pageBean) {
		StringBuffer hql = new StringBuffer("FROM SupplyJoinInfo sji WHERE 1 = 1");
		List<Object> list = null;
		if (map != null) {
			list = new ArrayList<Object>();
			String sic = map.get(Parm.SIC);
			String deleted = map.get(Parm.DELETED);
			if (sic != "" && isNotNull(sic)) {
				hql.append(" AND sji.sic = ? ");
				list.add(Integer.parseInt(sic));
			}
			if (deleted != "" && isNotNull(deleted)) {
				hql.append(" AND sji.deleted = ?");
				list.add(Boolean.parseBoolean(deleted));
			}
		}
		hql.append(" ORDER BY sji.code");

		return findToPageBean(hql.toString(), pageBean, list);
	}
}
